//
//  PxTextField.m
//  Express
//
//  Created by 泰然财富 on 15/6/17.
//  Copyright (c) 2015年 泰然财富. All rights reserved.
//

#import "PxTextField.h"
#import "UIView+Sizes.h"
#import "PxGlobal.h"

@implementation PxTextField

-(CGFloat)getLeft:(CGRect)bounds
{
    return self.leftView.right + [PxGlobal getCustomerWidth:_indent];
}

-(CGFloat)getWidth:(CGRect)bounds
{
    return bounds.size.width - self.leftView.right - self.rightView.width - [PxGlobal getCustomerWidth:_indent];
}

-(CGRect)placeholderRectForBounds:(CGRect)bounds
{
    
    CGRect inset = CGRectMake([self getLeft:bounds], bounds.origin.y, [self getWidth:bounds], bounds.size.height);//更好理解些
    return inset;
}

-(CGRect)editingRectForBounds:(CGRect)bounds
{
    CGRect inset = CGRectMake([self getLeft:bounds], bounds.origin.y, [self getWidth:bounds], bounds.size.height);//更好理解些
    return inset;
}

-(CGRect)textRectForBounds:(CGRect)bounds
{
    CGRect inset = CGRectMake([self getLeft:bounds], bounds.origin.y, [self getWidth:bounds], bounds.size.height);//更好理解些
    return inset;
}

@end